<?php

namespace App\Events;

use App\Kuafu\Base\Model\BaseModel;
use App\Library\OperationLog\OperationLog;
use Illuminate\Broadcasting\Channel;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Http\Request;


class OperationLogEvent extends BaseEvent
{

    public Request $request;
    public string  $module;
    public string  $logDesc;
    public array   $translate;
    public array   $operationLogGroup;

    /**
     * Create a new event instance.
     *
     * @return void
     */
    public function __construct(Request $request, string $module, string $logDesc, array $operationLogGroup)
    {
        $this->request           = $request;
        $this->logDesc           = $logDesc;
        $this->module            = $module;
        $this->operationLogGroup = $operationLogGroup;
    }

    /**
     * Get the channels the event should broadcast on.
     *
     * @return Channel
     */
    public function broadcastOn()
    {
        return new PrivateChannel('channel-name');
    }
}
